var LUA_API = [
	{
		name: "World",
		description: "The World class is the main data structure and exposes all important methods to manipulate the virtual world.",
		methods: [
			{
				name: "World",
				arguments: [
					{name: "name", type: "string", description: "World name"}
				],
				returns: "",
				description: "Constructor",
				example: "w = World( 'New World' )"
			},
			{
				name: "addCountry",
				arguments: [
					{name: "country", type: "Country", description: "Country object to be added"}
				],
				returns: "void",
				description: "Adds a country to the world object.",
				example: "world:addCountry( Country('Germany') )"
			},
			{
				name: "getCountryByName",
				arguments: [
					{name: "name", type: "string", description: "Name of the country"}
				],
				returns: "Country",
				description: "Finds a country by its name.",
				example: "world:getCountryByName( 'Germany' )"
			},
			{
				name: "getCountryByIndex",
				arguments: [
					{name: "index", type: "int", description: "List index of the country"}
				],
				returns: "Country",
				description: "Finds a country by its list index",
				example: "for i=0,world.Countries.Count - 1 do\n\tc = world:getCountryByIndex( i )\nend"
			},
			{
				name: "getPlayerCountry",
				arguments: [],
				returns: "Country",
				description: "Finds the country played by the user.",
				example: "world:getPlayerCountry( )"
			},
			{
				name: "addEvent",
				arguments: [
					{name: "event", type: "Event", description: "Event object to be added"}
				],
				returns: "bool",
				description: "Registers an event and adds it to the Events list.",
				example: "result = world:addEvent( ev )"
			},
			{
				name: "getEventByName",
				arguments: [
					{name: "name", type: "string", description: "Name of the event"}
				],
				returns: "Event",
				description: "Finds an event by its name.",
				example: "world:getEventByName( 'SomeEvent' )"
			},
			{
				name: "getEventByIndex",
				arguments: [
					{name: "index", type: "int", description: "List index of the event"}
				],
				returns: "Event",
				description: "Finds an event by its list index",
				example: "for i=0,world.Events.Count - 1 do\n\tev = world:getEventByIndex( i )\nend"
			},
			{
				name: "addProperty",
				arguments: [
					{name: "property", type: "Property", description: "Property object to be added"}
				],
				returns: "bool",
				description: "Registers a new property and adds it to the Properties list.",
				example: "result = world:addProperty( p )"
			},
			{
				name: "getPropertyByName",
				arguments: [
					{name: "name", type: "string", description: "Name of the property"}
				],
				returns: "Property",
				description: "Finds a property by its name.",
				example: "world:getPropertyByName( 'SomeEvent' )"
			},
			{
				name: "getPropertyByIndex",
				arguments: [
					{name: "index", type: "int", description: "List index of the property"}
				],
				returns: "Property",
				description: "Finds a property by its list index",
				example: "for i=0,world.Properties.Count - 1 do\n\tp = world:getPropertyByIndex( i )\nend"
			},
			{
				name: "movePerson",
				arguments: [
					{name: "person", type: "Person", description: "Person object to be added"},
					{name: "country", type: "Country|String", description: "Country object or name, the person should be moved to"},
				],
				returns: "void",
				description: "Adds a person to a country.",
				example: "world:addPerson( Person('Peter Mustermann'), 'Germany')"
			},
		],
		properties: [
			{
				name: "Author",
				type: "string",
				description: "The authors name. Meta information for later use.",
				get: true,
				set: true
			},
			{
				name: "Version",
				type: "int",
				description: "The version of the world object. Meta information for later use.",
				get: true,
				set: true
			},
			{
				name: "Name",
				type: "string",
				description: "The name of the world object. Meta information for later use.",
				get: true,
				set: true
			},
			{
				name: "Countries",
				type: "ExtendedList of Country",
				description: "The list containing all the countries of the world.",
				get: true,
				set: true
			},
			{
				name: "Events",
				type: "ExtendedList of Event",
				description: "The list containing all the events registered in the world.",
				get: true,
				set: true
			},
			{
				name: "Properties",
				type: "ExtendedList of Property",
				description: "The list containing all available properties in the world.",
				get: true,
				set: true
			},
			{
				name: "PlayerCountryKey",
				type: "string",
				description: "The name of the country played by the user.",
				get: true,
				set: true
			},
		]
	},
	{
		name: "Country",
		description: "The country class represents the geographic object of a country and is at the same time the object that represents the player.",
		methods: [
			{
				name: "Country",
				arguments: [
					{name: "name", type: "string", description: "Country name"}
				],
				returns: "",
				description: "Constructor",
				example: "c = Country( 'New Country' )"
			},
			{
				name: "addPerson",
				arguments: [
					{name: "person", type: "Person", description: "Person object to add"}
				],
				returns: "void",
				description: "Adds a person to the country.",
				example: "country:addPerson( p )"
			},
			{
				name: "removePerson",
				arguments: [
					{name: "person", type: "Person", description: "Person object to remove from the country"}
				],
				returns: "Person",
				description: "Removes a person from the country and returns it.",
				example: "country:removePerson( p )"
			},
			{
				name: "getPersonByName",
				arguments: [
					{name: "name", type: "string", description: "Name of the person"}
				],
				returns: "Person",
				description: "Finds a person by its name",
				example: "p = country:getPersonByName( 'Some Person' )"
			},
			{
				name: "getPersonByIndex",
				arguments: [
					{name: "index", type: "int", description: "List index of the person"}
				],
				returns: "Person",
				description: "Finds a person by its list index.",
				example: "for i=0,country.Persons.Count - 1 do\n\tp = country:getPersonByIndex( i )\nend"
			},
			{
				name: "addProperty",
				arguments: [
					{name: "property", type: "Property", description: "Property object to add"}
				],
				returns: "void",
				description: "Adds a property to the country.",
				example: "country:addProperty( p )"
			},
			{
				name: "removeProperty",
				arguments: [
					{name: "property", type: "Property", description: "Property object to remove"}
				],
				returns: "Property",
				description: "Removes a property from the country and returns it.",
				example: "country:removeProperty( p )"
			},
			{
				name: "getPropertyByName",
				arguments: [
					{name: "name", type: "string", description: "Name of the property"}
				],
				returns: "Property",
				description: "Finds a property by its name.",
				example: "p = country:getPropertyByName( 'SomeProperty' )"
			},
			{
				name: "getPropertyByIndex",
				arguments: [
					{name: "index", type: "int", description: "List index of the property"}
				],
				returns: "Property",
				description: "Finds a property by its list index.",
				example: "for i=0,country.Properties.Count - 1 do\n\tp = country:getPropertyByIndex( i )\nend"
			}
		],
		properties: [
		 	{
				name: "Description",
				type: "string",
				description: "A short description of the country that can be shown to the player.",
				get: true,
				set: true
			},
			{
				name: "Name",
				type: "string",
				description: "The country's name.",
				get: true,
				set: true
			},
			{
				name: "Persons",
				type: "ExtendedList of Person",
				description: "List of persons registered with this country.",
				get: true,
				set: true
			},
			{
				name: "Playable",
				type: "bool",
				description: "Indicates whether or not the country can be played by the user.",
				get: true,
				set: true
			},
			{
				name: "Properties",
				type: "ExtendedList of Property",
				description: "List of properties of this country.",
				get: true,
				set: true
			},
		]
	},
	{
		name: "Event",
		description: "Events are the main game logic objects. They define actions inside the Lua scripting environment. Each action inside the game is defined by an event object. Examples of such actions are user actions, opponent actions or global game actions.",
		methods: [],
		properties: []
	},
	{
		name: "Person",
		description: "The person class represents a person that has a number of properties that can affect the behavior of some events. Person objects belong to a country.",
		methods: [],
		properties: []
	},
	{
		name: "Property",
		description: "The property class is the main structure that defines a simple property. There are different kinds of properties: global, country and person properties. They hold the defining data of the whole virtual world.",
		methods: [],
		properties: []
	},
];

if(window.API_DATA == null) {
	window.API_DATA = {};
}

window.API_DATA.LUA = LUA_API;
LUA_API = null;